import {Module} from '@nestjs/common';
import {TypeOrmModule} from '@nestjs/typeorm';
import {GraphQLModule} from '@nestjs/graphql';
import {SystemModule} from './modules/system/system.module';

@Module({
    imports: [
        TypeOrmModule.forRoot({
            type: 'mysql',
            host: '127.0.0.1',
            port: 3306,
            username: 'root',
            password: 'root',
            database: 'serverless_test',
            synchronize: true, // 自动同步数据模型到数据表中
            logging: true, // 是否打印日志
            entities: [
                __dirname + '/**/*.entity{.ts,.js}'],
        }),
        GraphQLModule.forRoot({
            typePaths: ['./**/*.graphql'],
            debug: false,
            playground: true,
        }),
        SystemModule,
    ],
})
export class AppModule {
}
